Update webui.py offline mode#253
Conversation
the original webui.py cannot run without internet connection. Now, it could run offline, if we already run it once before with models in huggingface cache.
|
SenseVoice user, like me, might use webui feature in any situations, including under internet firewall, Local Area Network, even offline. Therefore, the offline mode is vital. Please help me if the code could be better. Thanks!!! |
LauraGPT
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The offline fallback idea is good, but a few suggestions:
-
The try/except is too broad - it will catch all errors (not just network issues), potentially hiding real bugs. Consider catching a more specific exception or checking network availability first.
-
A simpler approach: AutoModel already supports local paths directly. Users can just pass the local cache path as
modelparameter without needing a fallback mechanism: -
Consider adding a command-line flag (e.g.
--offline) instead of silent fallback, so users explicitly choose offline mode.
Please update the PR with these suggestions, or let me know your thoughts.
the original webui.py cannot run without internet connection.
Now, if we already run it once before, it could run offline with models in huggingface cache.